package cn.iocoder.yudao.module.english.dal.mysql.level;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.english.controller.admin.level.vo.LevelManagementPageReqVO;
import cn.iocoder.yudao.module.english.dal.dataobject.level.LevelManagementDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 级别管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LevelManagementMapper extends BaseMapperX<LevelManagementDO> {

    default PageResult<LevelManagementDO> selectPage(LevelManagementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LevelManagementDO>()
                .eqIfPresent(LevelManagementDO::getParentId, reqVO.getParentId())
                .likeIfPresent(LevelManagementDO::getLevelName, reqVO.getLevelName())
                .eqIfPresent(LevelManagementDO::getSort, reqVO.getSort())
                .eqIfPresent(LevelManagementDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(LevelManagementDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LevelManagementDO::getId));
    }

}